﻿using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using DevExpress.XtraReports.UI;
using DevExpress.XtraEditors;
using System.Windows.Forms;
using System.Data;

using QLTTAN.BLL;
using QLTTAN.DTO;
namespace QLTTAN.Report
{
    public partial class rpBaoCaoHocVu : DevExpress.XtraReports.UI.XtraReport
    {
        BaoCaoBLL BC_BLL;
        KhoaHocBLL KH_BLL;

        public rpBaoCaoHocVu()
        {
            InitializeComponent();
        }

        public rpBaoCaoHocVu(int makhoa)
        {
            InitializeComponent();

            BC_BLL = new BaoCaoBLL();
            KH_BLL = new KhoaHocBLL();

            lblNgayLap.Text = DateTime.Now.ToString("dd/MM/yyyy");

            try
            {
                KhoaHocDTO KH_DTO = new KhoaHocDTO();
                KH_DTO.MaKhoaHoc = makhoa;
                lblKhoa.Text = KH_BLL.KhoaHoc_GetInfo(KH_DTO)["TenKhoaHoc"].ToString();

                DataTable dt = BC_BLL.BaoCao_LoadBaoCaoHocVu(makhoa);
                this.DataSource = dt;
                this.DataMember = dt.TableName;
            }
            catch (Exception ex)
            {
                XtraMessageBox.Show(ex.Message, "Thông báo!!!", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
        }

        private void Detail_BeforePrint(object sender, System.Drawing.Printing.PrintEventArgs e)
        {
        }
    }
}
